package com.company;

public class Main {
    public static int MaxSubSumOfSequence(int[] array){
        if(array == null || array.length == 0){
            return Integer.MAX_VALUE;
        }
        int maxsum = Integer.MIN_VALUE;
        int sum = 0;
        for(int i =0;i < array.length;i++){
            if(sum < 0){
                sum = array[i];
            }else{
                sum +=array[i];
            }
            maxsum = Math.max(maxsum,sum);
        }
        return maxsum;
    }


    public static void main(String[] args) {
	int a[] =null;
    int x=MaxSubSumOfSequence(a);
    System.out.println(x);
    }
}
